package com.vanzo.bean;

import com.vanzo.encryption.Encryption;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Generated;

import java.util.Arrays;

/**
 * Created by tisen on 2018/3/5.
 */
@Entity
public class Follower {

    @Id(autoincrement = true)
    private Long id;
    private int terminalId;
    private byte[] killKey;
    private boolean killStatus;
    private boolean isBind;

    private byte[] nfc;

    public byte[] getNFC(Master master) {
        nfc = Encryption.getNfc2(master, this);
        return nfc;
    }

    public Follower(int terminalId, byte[] killKey) {
        this.terminalId = terminalId;
        this.killKey = killKey;
        this.killStatus = false;
        this.isBind = false;
    }

    public Follower(int terminalId) {
        this.terminalId = terminalId;
    }


    @Generated(hash = 1244220942)
    public Follower(Long id, int terminalId, byte[] killKey, boolean killStatus,
            boolean isBind, byte[] nfc) {
        this.id = id;
        this.terminalId = terminalId;
        this.killKey = killKey;
        this.killStatus = killStatus;
        this.isBind = isBind;
        this.nfc = nfc;
    }

    public byte[] getNFC() {

        return null;
    }


    @Generated(hash = 1675995425)
    public Follower() {
    }


    @Override
    public String toString() {
        return "Follower{" +
                "id=" + id +
                ", terminalId=" + terminalId +
                ", killKey=" + killKey +
                ", killStatus=" + killStatus +
                ", isBind=" + isBind +
                '}';
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public int getTerminalId() {
        return terminalId;
    }

    public void setTerminalId(int terminalId) {
        this.terminalId = terminalId;
    }

    public byte[] getKillKey() {
        return killKey;
    }

    public void setKillKey(byte[] killKey) {
        this.killKey = killKey;
    }

    public boolean isKillStatus() {
        return killStatus;
    }

    public void setKillStatus(boolean killStatus) {
        this.killStatus = killStatus;
    }

    public boolean isBind() {
        return isBind;
    }

    public void setBind(boolean bind) {
        isBind = bind;
    }


    public boolean getKillStatus() {
        return this.killStatus;
    }


    public boolean getIsBind() {
        return this.isBind;
    }


    public void setIsBind(boolean isBind) {
        this.isBind = isBind;
    }

    public static Follower crate(int i) {
        return null;
    }

    public void switchKillState() {
        killStatus = !killStatus;
    }

    public byte[] getNfc() {
        return this.nfc;
    }

    public void setNfc(byte[] nfc) {
        this.nfc = nfc;
    }
}
